unit shape;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, ExtCtrls, OpenGL, Shapes;

type
  TForm1 = class(TForm)
    Timer1: TTimer;
    Image1: TImage;
    procedure Image1Click(Sender: TObject);
    procedure Timer1Timer(Sender: TObject);
    procedure FormCreate(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
 
var
  Form1: TForm1;
  arr: Array[0..99] of TShape;

implementation

{$R *.dfm}
  function FPoint( x, y: real ): TFPoint;
  begin
    Result.x := x;
    Result.y := y;
  end;


procedure TForm1.Image1Click(Sender: TObject);
var a: Exception;
begin
  a := Exception.Create( 'Fatal error' );
  Application.ShowException( a );
end;

procedure TForm1.Timer1Timer(Sender: TObject);
var
  i: integer;
  bmp: TBitmap;
begin
  bmp := TBitmap.Create;
  bmp.Width := Image1.Width;
  bmp.Height := Image1.Height;
  For i := 0 to 74 do
    arr[i].Move( 16 );
  For i := 0 to 99 do
    arr[i].Draw( bmp.Canvas );
  Image1.Picture.Bitmap := bmp;
  bmp.Free
end;

procedure TForm1.FormCreate(Sender: TObject);
var i: Integer;
begin
  for i := 0 to 49 do
    arr[i] := TCircle.Create( Form1.Width, Form1.Height, 32 );
  for i := 49 to 74 do
    arr[i] := TRectangle.Create( Form1.Width, Form1.Height, 32 );
  for i := 75 to 99 do
    arr[i] := TRectangle.Create( FPoint((i-75)*30,(i-75)*30), 50 );
end;


end.
